package com.ws.exer;
/*
获取arr数组中所有元素的和
 */
public class ArrayExercise1 {
    public static void main(String[] args) {

        int[][] arr = new int[][]{{3, 5, 8}, {12, 9}, {7, 0, 6, 4}};

        int sum = 0; //记录总和
        for (int[] ar1: arr) {
            for (int ar: ar1) {
                sum += ar;
            }
        }
        System.out.println("总和为" + sum);
    }
}
